﻿#region 命名空间

using System;
using WinnerCMS.BLL;
using WinnerCMS.Common;
using WinnerCMS.Model.Attribute;
using WinnerCMS.Model.Enum;
using WinnerCMS.WebFactory;

#endregion

namespace WinnerCMS.WebUI.Admin.Shop
{
    [Access]
    public partial class SelectCategory : PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                new CategoryManage().BindDDL(this.ListBox1, BindOption.NoLink, "<请选择栏目>", byte.Parse(Request["ModelId"]));
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (this.ListBox1.SelectedIndex == 0)
            {
                MsgBox.Message("请选择栏目！", this);
                return;
            }
            if (Session["SelectCategoryId"] != null)
            {
                this.ListBox1.SelectedValue = Session["SelectCategoryId"].ToString();
            }
            Response.Redirect("Add.aspx?ModelId=" + Request["ModelId"] + "&CategoryId=" + this.ListBox1.SelectedValue);
        }
    }
}